package lab02.test21;

/**
 * Created by 唐苗苗 on 2017/11/1.
 */
public class Test {
    public static void main(String[] args) {
        String str="hengaoxingxuexijava";
        int num=0;
        int i;
        //
        for(i=0;i<str.length();i++){
            if (str.charAt(i)=='x'){
                num++;
            }
        }
        System.out.println("x出现的次数："+num);
    }
}
